﻿@model IEnumerable<AMG.UserForms.ViewModels.UploadedFile>


<table>

@{ int index=0; }
@foreach (var item in Model) {
    <tr>
        <td>
            @item.FileName
        </td>
        <td width="50px">
            @if (item.FileName.EndsWith("jpg") || item.FileName.EndsWith("gif") || item.FileName.EndsWith("png") || item.FileName.EndsWith("bmp"))
            {
                if (item.FileData != null && item.FileData.Length > 0)
                {
                    var url = Url.Action("RenderImage", "ArchChange", new { index });
                    url = string.Format("{0}&{1}", url, Guid.NewGuid().ToString());
                    <img src="@url" alt="image" />
                }
            }
        </td>
        <td>
            <img src="../../Content/images/delete.png" alt="remove" onclick="RemoveFile(@index);" style="cursor:pointer" />
        </td>
    </tr>
    {index++;}
}

</table>

